package com.wipz.eoa.iphone.businessProcess;

import java.util.ArrayList;
import java.util.List;

import com.toft.widgets.workflow.factory.ServiceFactory;
import com.toft.widgets.workflow.factory.impl.ServiceFactoryImpl;
import com.toft.widgets.workflow.provider.ApprocalAssistance;

public class TaskTransitionService {
	public List getTaskTransition(String taskId) {
		List taskTransitions = new ArrayList();
		String name = "";
		// 通过以下方式获取真实的数据
		try {
			ApprocalAssistance.beginTransaction();
			taskTransitions = getServiceFactory().getWorkflowQueryService().getTaskTransitions(taskId);
			name = getServiceFactory().getWorkflowQueryService().getEndTransitionByTaskId(taskId);
			ApprocalAssistance.commitTransaction();
		} catch (Exception e) {
			ApprocalAssistance.rollbackTransaction();
			e.printStackTrace();
		}
		/*if (null != taskTransitions && taskTransitions.size() > 0) {
			System.out.println("size:"+taskTransitions.size());
			for (Iterator iter = taskTransitions.iterator(); iter.hasNext();) {
				TransitionInfo transition  = (TransitionInfo) iter.next();
				System.out.println("getActivityName:"+transition.getActivityName());
				System.out.println("getName:"+transition.getName());
				System.out.println("getPass:"+transition.getPass());
			}
		}*/
		
		return taskTransitions;

	}
	
	private ServiceFactory getServiceFactory() {
		return ServiceFactoryImpl.getServiceFactory();
	}
	
}
